﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PPE4_Diaz
{
    public partial class Form1 : Form
    {
        private type_soins ftype_soins1;
        public Form1()
        {
            InitializeComponent();
            controller.init();
        }

        private void importToolStripMenuItem_Click(object sender, EventArgs e)
        {

            controller.Vmodel.seconnecter();
            if (controller.Vmodel.Connopen)
            {
                gestionDesTypesDeSoinsToolStripMenuItem.Enabled = true;
                gestionDesSoinsToolStripMenuItem.Enabled = true;
            }
            controller.Vmodel.import();
            controller.Vmodel.sedeconnecter();


        }

        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (controller.Vmodel != null)
            {
                if (controller.Vmodel.Connopen)
                {
                    controller.Vmodel.sedeconnecter();
                }
            }

        }
        private void gestionDesTypesDeSoinsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ftype_soins1 = new type_soins();
            ftype_soins1.MdiParent = this;
            ftype_soins1.Show();
        }
    }
}
